package com.wulinbus.controller.admin;

import java.io.IOException;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.wulinbus.service.CreativeService;
import com.wulinbus.service.ScriptBannerService;
import com.wulinbus.service.ScriptService;
import com.wulinbus.utils.AdminAuthCheck;

@Controller
@AdminAuthCheck
@RequestMapping("/admin/script_check")
public class AdminScriptCheckController {

	@Resource
	private ScriptBannerService scriptBannerService;
	@Resource
	private ScriptService scriptService;
	
	/**
	 * 剧本删除
	 */
	@RequestMapping(value = "/script_delete.json", method = { RequestMethod.POST })
	public void script_delete(Model model,Integer sid, HttpServletRequest request, HttpServletResponse response) throws IOException {
		response.setContentType("application/json; charset=utf-8");
		if(scriptService.delete(sid)>0){
			response.getWriter().print("{\"message\":\"操作成功\",\"statusCode\":\"200\"}");
		}
		else
		{
			response.getWriter().print("{\"message\":\"操作失败\",\"statusCode\":\"300\"}");
		}
	}

}
